package homework.test01;

import java.util.Random;
import java.util.TreeSet;

public class demo01 {
    public static void main(String[] args) {
        Random r = new Random();
        TreeSet<Integer> set = new TreeSet<>();
            while (set.size() < 10) {
                set.add(r.nextInt(0, 51));
            }
        System.out.println(set);

        TreeSet<Integer> set2 = new TreeSet<>((o1, o2) -> o2 - o1);
        while (set2.size() < 10) {
            set2.add(r.nextInt(50, 101));
        }
        System.out.println(set2);
      }
}
